<!DOCTYPE HTML>
<html>
<head>
  <meta charset="utf-8">
  <title>欢迎来到加帕里集市</title>
  <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
  <meta name="keywords" content="校园，二手交易，加帕里，论坛">
  <meta name="description" content="校园二手物品交流平台——加帕里集市">
  <link rel="stylesheet" href="${pageContext.request.contextPath}/static/layui/css/layui.css">
  <link rel="stylesheet" href="${pageContext.request.contextPath}/static/css/global.css">
</head>
<body>

<div class="fly-header layui-bg-black">
  <div class="layui-container">
    <a class="fly-logo" href="${pageContext.request.contextPath}/index">
      <img src="${pageContext.request.contextPath}/static/images/logo.png" alt="layui">
    </a>

    <ul class="layui-nav fly-nav-user">
      <c:choose>
        <c:when test="${user == null}">
          <!-- 未登入的状态 -->
          <li class="layui-nav-item">
            <a class="iconfont icon-touxiang layui-hide-xs" href="user/login.jsp"></a>
          </li>
          <li class="layui-nav-item">
            <a href="${pageContext.request.contextPath}/user/login">登入</a>
          </li>
          <li class="layui-nav-item">
            <a href="${pageContext.request.contextPath}/user/regist">注册</a>
          </li>
        </c:when>
        <c:otherwise>
          <!-- 登入后的状态 -->
          <li class="layui-nav-item">
            <a class="fly-nav-avatar" href="javascript:;">
              <cite class="layui-hide-xs">${user.getUname()}</cite>
              <c:if test="${user.getUauth() == 1}"><i class="layui-badge fly-badge-vip layui-hide-xs">管理员</i></c:if>
              <img src="${user.getUid()}.jpg">
            </a>
            <dl class="layui-nav-child">
              <dd><a href="${pageContext.request.contextPath}/user/set"><i class="layui-icon">&#xe620;</i>基本设置</a></dd>
              <dd><a href="${pageContext.request.contextPath}/user/message"><i class="iconfont icon-tongzhi" style="top: 4px;"></i>消息</a>
              </dd>
              <dd><a href="${pageContext.request.contextPath}/user/home"><i class="layui-icon"
                                                                            style="margin-left: 2px; font-size: 22px;">&#xe68e;</i>我的主页</a>
              </dd>
              <hr style="margin: 5px 0;">
              <dd><a href="${pageContext.request.contextPath}/user/logout" style="text-align: center;">退出</a></dd>
            </dl>
          </li>
        </c:otherwise>
      </c:choose>
    </ul>
  </div>
</div>

<div class="fly-panel fly-column">
  <div class="layui-container">
    <%--首页（显示所有消息）、
    公告（显示所有公告）、
    二手（按照时间，显示所有二手帖）、
    图文（按照时间，显示所有图文帖）、
    我的关注（显示包含关键词的所有内容，添加删除关键词）
    小红点<span class="layui-badge-dot"></span>--%>
    <ul class="layui-clear">
      <li class="layui-hide-xs layui-this"><a href="/">首页</a></li>
      <li><a href="jie/index.html">公告</a></li>
      <li><a href="jie/index.html">二手</a></li>
      <li><a href="jie/index.html">图文</a></li>
      <li class="layui-hide-xs layui-hide-sm layui-show-md-inline-block">
        <span class="fly-mid"></span>
      </li>
      <%--
      <!-- 用户登入后显示 -->
      <li class="layui-hide-xs layui-hide-sm layui-show-md-inline-block"><a href="#">我的发布</a></li>
      <li class="layui-hide-xs layui-hide-sm layui-show-md-inline-block"><a href="#">我的关注</a></li>
      --%>
    </ul>

    <div class="fly-column-right layui-hide-xs">
      <span class="fly-search"><i class="layui-icon"></i></span><%--查找按钮--%>
      <a href="user/login.jsp" class="layui-btn">发布</a>
    </div>
    <%--登陆后的发布--%>
    <div class="layui-hide-sm layui-show-xs-block"
         style="margin-top: -10px; padding-bottom: 10px; text-align: center;">
      <a href="jie/add.html" class="layui-btn">发布</a>
    </div>
  </div>
</div>

<div class="layui-container fly-marginTop">
	<div class="fly-panel">
	  <div class="fly-none">
	    <h2><i class="iconfont icon-404"></i></h2>
	    <p>页面或者数据被<a href="http://fly.layui.com/u/336" target="_blank"> 纸飞机 </a>运到火星了，啥都看不到了…</p>
	  </div>
	</div>
</div>

<div class="fly-footer">
  <p><a href="#" target="_blank">加帕里集市</a> 2020 &copy; <a href="#" target="_blank">Haoo</a></p>
</div>

<script src="${pageContext.request.contextPath}/static/layui/layui.js"></script>
<script>
  layui.cache.page = '';
  layui.cache.user = {
    username: '游客'
    , uid: -1
    , avatar: '${pageContext.request.contextPath}/static/images/avatar/00.jpg'
    , sex: '男'
  };
  layui.config({
    version: "3.0.0"
    , base: '${pageContext.request.contextPath}/static/mods/' //这里实际使用时，建议改成绝对路径
  }).extend({
    fly: 'index'
  }).use('fly');
</script>

</body>
</html>